﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Linq;
using System.Web;

namespace RepertorySystem.Models {
    public class BookModels {

        [Display(Name = "ID")]
        public int ID { get; set; }

        [Display(Name = "书名")]
        [Required]
        [StringLength(50, MinimumLength = 2)]
        public string Name { get; set; }

        [Display(Name = "类别")]
        [Required]
        [StringLength(50, MinimumLength = 2)]
        public String Type { get; set; }

        [Display(Name = "购入价格")]
        [Required]
        [Range(0,10000)]
        public int InPrice { get; set; }

        [Display(Name = "出售价格")]
        [Required]
        [Range(0, 10000)]
        public int OutPrice { get; set; }

    }

    public class BookDbContext : DbContext {
        public DbSet<BookModels> Books { get; set; }
    }
}